package androidx.appcompat.view.menu;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.d;
import o.bd;
import o.bd.a;
import o.bj;
import o.bo;
import o.cw;

@RestrictTo({d.LIBRARY_GROUP})
public final class ExpandedMenuView extends ListView implements a, bo, OnItemClickListener {
    private static final int[] ˊ = new int[]{16842964, 16843049};
    private bd ˋ;

    public ExpandedMenuView(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, 16842868);
    }

    public ExpandedMenuView(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet);
        setOnItemClickListener(this);
        cw ॱ = cw.ॱ(context, attributeSet, ˊ, i, 0);
        if (ॱ.ᐝ(0)) {
            setBackgroundDrawable(ॱ.ˋ(0));
        }
        if (ॱ.ᐝ(1)) {
            setDivider(ॱ.ˋ(1));
        }
        ॱ.ॱ();
    }

    public void ˎ(bd bdVar) {
        this.ˋ = bdVar;
    }

    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        setChildrenDrawingCacheEnabled(false);
    }

    public boolean ॱ(bj bjVar) {
        return this.ˋ.ˎ((MenuItem) bjVar, 0);
    }

    public void onItemClick(AdapterView adapterView, View view, int i, long j) {
        ॱ((bj) getAdapter().getItem(i));
    }
}
